from Publisher import Publisher
from Observer import Observer
from Event import Event


class HexFormatter(Observer):
    def update(self, publiser):
        print("hex data = {}".format(publiser.getEvent()))


class BinaryFormatter(Observer):
    def update(self, publiser):
        print("Bin data = {}".format(publiser.getEvent()))


def Datadd():
    event = Event('11111111111')
    publisher = Publisher(event)
    publisher.addObserver(HexFormatter())
    publisher.addObserver(BinaryFormatter())
    publisher.notify()

if __name__ == '__main__':
    Datadd()